package com.Thread02.demo01;

import java.util.concurrent.ArrayBlockingQueue;

public class Foodie extends Thread {
    public ArrayBlockingQueue<String> list;

    public Foodie(ArrayBlockingQueue<String> list) {
        this.list = list;
    }

    @Override
    public void run() {
        String take = null;
        try {
            take = list.take();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("吃货从队列中拿取" + take);
    }
}
